import request from "@/router/axios";
const base_url = "http://10.200.1.71:9999";
// const base_url = "http://10.59.1.203:9999";
export function findCarPage(data) {
  return request({
    url: base_url + "/ppc/admin/car/findCarPage",
    method: "get",
    params: data
  });
}
export function findLongCarPage(data) {
  return request({
    url: base_url + "/ppc/admin/car/findLongCarPage",
    method: "get",
    params: data
  });
}
export function findTemporaryCarPage(data) {
  return request({
    url: base_url + "/ppc/admin/car/findTemporaryCarPage",
    method: "get",
    params: data
  });
}
export function findCarSpacePage(data) {
  return request({
    url: base_url + "/ppc/admin/car/findSpaceCarPage",
    method: "get",
    params: data
  });
}


// 公共导出文件
export function ExportFile(url, obj) {
  request({
    url:base_url + url,
    method: 'get',
    params: obj,
    responseType: 'blob'
  }).then(response => {
    if (!response) {
      return
    }
    let link = document.createElement('a')
    link.href = window.URL.createObjectURL(new Blob([response.data]))
    link.target = '_blank'
    let filename = response.headers['content-disposition']
    link.download = decodeURI(filename)
    document.body.appendChild(link)
    link.click()
    document.body.removeChild(link)
  })
}
// 文件导入
export function ImportFile(obj) {
  return request({
    url: base_url +"/ppc/admin/car/importSpaceCar",
    method: 'post',
    data: obj
  })
}
